/*
 *	mcm.c
 *
 *  Created on: 20/04/2011
 *
 */

#include <stdio.h>
#include <stdlib.h>

int mcm(int M, int N)
{
	int res;
	int mcd;
	int r[100];
	int i;

	r[0] = M;
	r[1] = N;
	i = 1;
	while (r[i] != 0)
	{
		r[i+1] = r[i-1] % r[i];
		i++;
	}
	
	mcd = r[i-1];

	res = M * N / mcd;

	return res;
}
